define(['hammer'],function(){
	//回到顶部
	$(window).scroll(function(){
		if($(window).scrollTop() > 100){
			$('.runTop').show();
		}else{
			$('.runTop').hide();
		}
	})
	new Hammer($(':not(.runTop)')[0]).on('press',function(){
		$('.runTop').hide();
	})
//	定时器
	$(function(){
		function ding(time,mind,seconds){
			var myDate=new Date();
			var times = [24,60,60];
			var t = $(time),m = $(mind),s = $(seconds);
				t.html(times[0] - myDate.getHours());
				m.html(times[1] - myDate.getMinutes());
				s.html(times[2] - myDate.getSeconds());
		}
		ding('.timess','.minmint','.seconds');
		setInterval(function(){
			ding('.timess','.minmint','.seconds');
			ding('.er','.mini','.se');
		},1000)
	})
	//底部加载
	$(function(){
		function bottonAdds(bigall,smalls){
			var top = $(window).scrollTop();
			var docH = $(document).height();;
			var winH = $(window).height();
			if((docH- top - winH) < 50){
				$(bigall).append($(smalls).eq(0).clone());
			}
		}
		$(window).scroll(function(){
			bottonAdds('.time-shop-all','.time-shop');
			bottonAdds('.main-item ul','.main-item ul li');
		})
	})
})